{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=r'D:\\aaa\\identity.sav'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "de_identity=pd.read_spss(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(905, 28)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "de_identity.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>问卷编号</th>\n",
       "      <th>调查员</th>\n",
       "      <th>民族</th>\n",
       "      <th>政治面貌</th>\n",
       "      <th>年级</th>\n",
       "      <th>您觉得自己是个典型的中国人吗</th>\n",
       "      <th>与世界其他国家的人相比中国人有自己的特点吗</th>\n",
       "      <th>v1</th>\n",
       "      <th>v2</th>\n",
       "      <th>v3</th>\n",
       "      <th>...</th>\n",
       "      <th>会隐瞒身份吗</th>\n",
       "      <th>会打多少分</th>\n",
       "      <th>国歌升起</th>\n",
       "      <th>世博会</th>\n",
       "      <th>中国传统文化</th>\n",
       "      <th>发展信心</th>\n",
       "      <th>你会为中国运动员呐喊助威</th>\n",
       "      <th>遇到灾难时中国人应该伸出援手</th>\n",
       "      <th>你愿意加入其他国籍吗</th>\n",
       "      <th>中国人要为祖国统一奋斗吗</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>851.0</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>壮族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>八十到一百</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>很赞同</td>\n",
       "      <td>其他</td>\n",
       "      <td>很赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>852.0</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>土家族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>可以算</td>\n",
       "      <td>非常有特点</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>八十到一百</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>没信心</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>853.0</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>回族</td>\n",
       "      <td>群众</td>\n",
       "      <td>大四</td>\n",
       "      <td>可以算</td>\n",
       "      <td>非常有特点</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>四十到六十</td>\n",
       "      <td>一般</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>赞同</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>854.0</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>土家族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>八十到一百</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>很赞同</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>很赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>855.0</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>彝族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>赞同</td>\n",
       "      <td>不加入</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>900</th>\n",
       "      <td>116.0</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>维吾尔族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大一</td>\n",
       "      <td>一般般</td>\n",
       "      <td>一般般</td>\n",
       "      <td>同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>感到非常激动</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>赞同</td>\n",
       "      <td>其他</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>901</th>\n",
       "      <td>117.0</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>汉族</td>\n",
       "      <td>党员</td>\n",
       "      <td>大三</td>\n",
       "      <td>可以算</td>\n",
       "      <td>非常有特点</td>\n",
       "      <td>同意</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>不一定</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>902</th>\n",
       "      <td>118.0</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>汉族</td>\n",
       "      <td>群众</td>\n",
       "      <td>大二</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较无特点</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>不同意</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>...</td>\n",
       "      <td>很可能不会</td>\n",
       "      <td>四十到六十</td>\n",
       "      <td>一般</td>\n",
       "      <td>比较好</td>\n",
       "      <td>比较肯定</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>不一定</td>\n",
       "      <td>不一定</td>\n",
       "      <td>不加入</td>\n",
       "      <td>不一定</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>903</th>\n",
       "      <td>119.0</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>汉族</td>\n",
       "      <td>党员</td>\n",
       "      <td>大一</td>\n",
       "      <td>完全是</td>\n",
       "      <td>一般般</td>\n",
       "      <td>同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>四十到六十</td>\n",
       "      <td>感到非常激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>其他</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>904</th>\n",
       "      <td>120.0</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>回族</td>\n",
       "      <td>群众</td>\n",
       "      <td>大四</td>\n",
       "      <td>一般般</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>感到非常激动</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>其他</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>905 rows × 28 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      问卷编号  调查员    民族 政治面貌  年级 您觉得自己是个典型的中国人吗 与世界其他国家的人相比中国人有自己的特点吗    v1  \\\n",
       "0    851.0   乔玮    壮族   团员  大四            完全是                  较有特点  完全同意   \n",
       "1    852.0   乔玮   土家族   团员  大四            可以算                 非常有特点  有点同意   \n",
       "2    853.0   乔玮    回族   群众  大四            可以算                 非常有特点  完全同意   \n",
       "3    854.0   乔玮   土家族   团员  大四            完全是                  较有特点  完全同意   \n",
       "4    855.0   乔玮    彝族   团员  大四            完全是                  较有特点    同意   \n",
       "..     ...  ...   ...  ...  ..            ...                   ...   ...   \n",
       "900  116.0  蔡远亮  维吾尔族   团员  大一            一般般                   一般般    同意   \n",
       "901  117.0  蔡远亮    汉族   党员  大三            可以算                 非常有特点    同意   \n",
       "902  118.0  蔡远亮    汉族   群众  大二            完全是                  较无特点  有点同意   \n",
       "903  119.0  蔡远亮    汉族   党员  大一            完全是                   一般般    同意   \n",
       "904  120.0  蔡远亮    回族   群众  大四            一般般                  较有特点  有点同意   \n",
       "\n",
       "       v2    v3  ... 会隐瞒身份吗  会打多少分    国歌升起   世博会     中国传统文化   发展信心  \\\n",
       "0    完全同意    同意  ...   绝对不会  八十到一百    比较激动   比较好  富有内涵，意义深刻  担忧不好说   \n",
       "1      同意  有点同意  ...    可能会  八十到一百    比较激动   比较好  富有内涵，意义深刻    没信心   \n",
       "2    完全同意  完全同意  ...   绝对不会  四十到六十      一般  感到自豪  富有内涵，意义深刻  担忧不好说   \n",
       "3    完全同意    同意  ...   绝对不会  八十到一百    比较激动  感到自豪  富有内涵，意义深刻   很有信心   \n",
       "4    完全同意  有点同意  ...   绝对不会  六十到八十    比较激动   比较好  富有内涵，意义深刻  担忧不好说   \n",
       "..    ...   ...  ...    ...    ...     ...   ...        ...    ...   \n",
       "900  完全同意  完全同意  ...    可能会  六十到八十  感到非常激动  感到自豪  富有内涵，意义深刻   很有信心   \n",
       "901  有点同意    同意  ...    可能会  六十到八十    比较激动   比较好  富有内涵，意义深刻   很有信心   \n",
       "902   不同意  有点同意  ...  很可能不会  四十到六十      一般   比较好       比较肯定  担忧不好说   \n",
       "903  完全同意    同意  ...    可能会  四十到六十  感到非常激动   比较好  富有内涵，意义深刻  担忧不好说   \n",
       "904    同意  有点同意  ...    可能会  六十到八十  感到非常激动  感到自豪  富有内涵，意义深刻   很有信心   \n",
       "\n",
       "    你会为中国运动员呐喊助威 遇到灾难时中国人应该伸出援手 你愿意加入其他国籍吗 中国人要为祖国统一奋斗吗  \n",
       "0        大多数情况下会            很赞同         其他          很赞同  \n",
       "1            肯定会            不一定      做外籍华人           赞同  \n",
       "2            肯定会             赞同      做外籍华人           赞同  \n",
       "3            肯定会            很赞同      做外籍华人          很赞同  \n",
       "4        大多数情况下会             赞同        不加入           赞同  \n",
       "..           ...            ...        ...          ...  \n",
       "900          肯定会             赞同         其他           赞同  \n",
       "901      大多数情况下会            不一定      做外籍华人          不一定  \n",
       "902          不一定            不一定        不加入          不一定  \n",
       "903          肯定会            不一定         其他           赞同  \n",
       "904      大多数情况下会            不一定         其他           赞同  \n",
       "\n",
       "[905 rows x 28 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "de_identity.dropna(axis=0).shape\n",
    "de_identity"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "def sss(a):\n",
    "    if a in [\"党员\",\"团员\",\"群众\"]:\n",
    "        return\"正常\"\n",
    "    else:\n",
    "        return\"异常\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>问卷编号</th>\n",
       "      <th>异常值查询</th>\n",
       "      <th>调查员</th>\n",
       "      <th>民族</th>\n",
       "      <th>政治面貌</th>\n",
       "      <th>年级</th>\n",
       "      <th>您觉得自己是个典型的中国人吗</th>\n",
       "      <th>与世界其他国家的人相比中国人有自己的特点吗</th>\n",
       "      <th>v1</th>\n",
       "      <th>v2</th>\n",
       "      <th>...</th>\n",
       "      <th>会隐瞒身份吗</th>\n",
       "      <th>会打多少分</th>\n",
       "      <th>国歌升起</th>\n",
       "      <th>世博会</th>\n",
       "      <th>中国传统文化</th>\n",
       "      <th>发展信心</th>\n",
       "      <th>你会为中国运动员呐喊助威</th>\n",
       "      <th>遇到灾难时中国人应该伸出援手</th>\n",
       "      <th>你愿意加入其他国籍吗</th>\n",
       "      <th>中国人要为祖国统一奋斗吗</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>851.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>壮族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>八十到一百</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>很赞同</td>\n",
       "      <td>其他</td>\n",
       "      <td>很赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>852.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>土家族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>可以算</td>\n",
       "      <td>非常有特点</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>八十到一百</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>没信心</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>853.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>回族</td>\n",
       "      <td>群众</td>\n",
       "      <td>大四</td>\n",
       "      <td>可以算</td>\n",
       "      <td>非常有特点</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>四十到六十</td>\n",
       "      <td>一般</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>赞同</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>854.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>土家族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>八十到一百</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>很赞同</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>很赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>855.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>乔玮</td>\n",
       "      <td>彝族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大四</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>绝对不会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>赞同</td>\n",
       "      <td>不加入</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>900</th>\n",
       "      <td>116.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>维吾尔族</td>\n",
       "      <td>团员</td>\n",
       "      <td>大一</td>\n",
       "      <td>一般般</td>\n",
       "      <td>一般般</td>\n",
       "      <td>同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>感到非常激动</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>赞同</td>\n",
       "      <td>其他</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>901</th>\n",
       "      <td>117.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>汉族</td>\n",
       "      <td>党员</td>\n",
       "      <td>大三</td>\n",
       "      <td>可以算</td>\n",
       "      <td>非常有特点</td>\n",
       "      <td>同意</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>比较激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>做外籍华人</td>\n",
       "      <td>不一定</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>902</th>\n",
       "      <td>118.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>汉族</td>\n",
       "      <td>群众</td>\n",
       "      <td>大二</td>\n",
       "      <td>完全是</td>\n",
       "      <td>较无特点</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>不同意</td>\n",
       "      <td>...</td>\n",
       "      <td>很可能不会</td>\n",
       "      <td>四十到六十</td>\n",
       "      <td>一般</td>\n",
       "      <td>比较好</td>\n",
       "      <td>比较肯定</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>不一定</td>\n",
       "      <td>不一定</td>\n",
       "      <td>不加入</td>\n",
       "      <td>不一定</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>903</th>\n",
       "      <td>119.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>汉族</td>\n",
       "      <td>党员</td>\n",
       "      <td>大一</td>\n",
       "      <td>完全是</td>\n",
       "      <td>一般般</td>\n",
       "      <td>同意</td>\n",
       "      <td>完全同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>四十到六十</td>\n",
       "      <td>感到非常激动</td>\n",
       "      <td>比较好</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>担忧不好说</td>\n",
       "      <td>肯定会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>其他</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>904</th>\n",
       "      <td>120.0</td>\n",
       "      <td>正常</td>\n",
       "      <td>蔡远亮</td>\n",
       "      <td>回族</td>\n",
       "      <td>群众</td>\n",
       "      <td>大四</td>\n",
       "      <td>一般般</td>\n",
       "      <td>较有特点</td>\n",
       "      <td>有点同意</td>\n",
       "      <td>同意</td>\n",
       "      <td>...</td>\n",
       "      <td>可能会</td>\n",
       "      <td>六十到八十</td>\n",
       "      <td>感到非常激动</td>\n",
       "      <td>感到自豪</td>\n",
       "      <td>富有内涵，意义深刻</td>\n",
       "      <td>很有信心</td>\n",
       "      <td>大多数情况下会</td>\n",
       "      <td>不一定</td>\n",
       "      <td>其他</td>\n",
       "      <td>赞同</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>905 rows × 29 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      问卷编号 异常值查询  调查员    民族 政治面貌  年级 您觉得自己是个典型的中国人吗 与世界其他国家的人相比中国人有自己的特点吗  \\\n",
       "0    851.0    正常   乔玮    壮族   团员  大四            完全是                  较有特点   \n",
       "1    852.0    正常   乔玮   土家族   团员  大四            可以算                 非常有特点   \n",
       "2    853.0    正常   乔玮    回族   群众  大四            可以算                 非常有特点   \n",
       "3    854.0    正常   乔玮   土家族   团员  大四            完全是                  较有特点   \n",
       "4    855.0    正常   乔玮    彝族   团员  大四            完全是                  较有特点   \n",
       "..     ...   ...  ...   ...  ...  ..            ...                   ...   \n",
       "900  116.0    正常  蔡远亮  维吾尔族   团员  大一            一般般                   一般般   \n",
       "901  117.0    正常  蔡远亮    汉族   党员  大三            可以算                 非常有特点   \n",
       "902  118.0    正常  蔡远亮    汉族   群众  大二            完全是                  较无特点   \n",
       "903  119.0    正常  蔡远亮    汉族   党员  大一            完全是                   一般般   \n",
       "904  120.0    正常  蔡远亮    回族   群众  大四            一般般                  较有特点   \n",
       "\n",
       "       v1    v2  ... 会隐瞒身份吗  会打多少分    国歌升起   世博会     中国传统文化   发展信心  \\\n",
       "0    完全同意  完全同意  ...   绝对不会  八十到一百    比较激动   比较好  富有内涵，意义深刻  担忧不好说   \n",
       "1    有点同意    同意  ...    可能会  八十到一百    比较激动   比较好  富有内涵，意义深刻    没信心   \n",
       "2    完全同意  完全同意  ...   绝对不会  四十到六十      一般  感到自豪  富有内涵，意义深刻  担忧不好说   \n",
       "3    完全同意  完全同意  ...   绝对不会  八十到一百    比较激动  感到自豪  富有内涵，意义深刻   很有信心   \n",
       "4      同意  完全同意  ...   绝对不会  六十到八十    比较激动   比较好  富有内涵，意义深刻  担忧不好说   \n",
       "..    ...   ...  ...    ...    ...     ...   ...        ...    ...   \n",
       "900    同意  完全同意  ...    可能会  六十到八十  感到非常激动  感到自豪  富有内涵，意义深刻   很有信心   \n",
       "901    同意  有点同意  ...    可能会  六十到八十    比较激动   比较好  富有内涵，意义深刻   很有信心   \n",
       "902  有点同意   不同意  ...  很可能不会  四十到六十      一般   比较好       比较肯定  担忧不好说   \n",
       "903    同意  完全同意  ...    可能会  四十到六十  感到非常激动   比较好  富有内涵，意义深刻  担忧不好说   \n",
       "904  有点同意    同意  ...    可能会  六十到八十  感到非常激动  感到自豪  富有内涵，意义深刻   很有信心   \n",
       "\n",
       "    你会为中国运动员呐喊助威 遇到灾难时中国人应该伸出援手 你愿意加入其他国籍吗 中国人要为祖国统一奋斗吗  \n",
       "0        大多数情况下会            很赞同         其他          很赞同  \n",
       "1            肯定会            不一定      做外籍华人           赞同  \n",
       "2            肯定会             赞同      做外籍华人           赞同  \n",
       "3            肯定会            很赞同      做外籍华人          很赞同  \n",
       "4        大多数情况下会             赞同        不加入           赞同  \n",
       "..           ...            ...        ...          ...  \n",
       "900          肯定会             赞同         其他           赞同  \n",
       "901      大多数情况下会            不一定      做外籍华人          不一定  \n",
       "902          不一定            不一定        不加入          不一定  \n",
       "903          肯定会            不一定         其他           赞同  \n",
       "904      大多数情况下会            不一定         其他           赞同  \n",
       "\n",
       "[905 rows x 29 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "de_identity.insert(1,\"异常值查询\",de_identity[\"政治面貌\"].apply(sss))\n",
    "de_identity"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "f065d2ce6a7651685f3ce378f5428ba9b81b62508dbd33576ed0cfd45a941a8b"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8rc1 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8rc1"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
